<template>
    <Table :columns="columns14" :data="data5" border :span-method="handleSpan"></Table>
</template>
<script>
export default {
  data () {
    return {
      columns14: [
        {
          title: '序号',
          align: 'center',
          type: 'index',
          width: 100
        },
        {
          title: '日期',
          width: 100,
          align: 'center',
          key: 'datetime'
        },
        {
          title: '大连',
          width: 100,
          align: 'center',
          key: 'dalian'
        },
        {
          title: '鞍山',
          width: 100,
          align: 'center',
          key: 'anshan'
        },
        {
          title: '抚顺',
          width: 100,
          align: 'center',
          key: 'fushun'
        },
        {
          title: '本溪',
          width: 100,
          align: 'center',
          key: 'benxi'
        },
        {
          title: '桓仁',
          width: 100,
          align: 'center',
          key: 'hengren'
        },
        {
          title: '铁岭',
          width: 100,
          align: 'center',
          key: 'tieling'
        },
        {
          title: '辽阳',
          width: 100,
          align: 'center',
          key: 'liaoyang'
        },
        {
          title: '营口',
          width: 100,
          align: 'center',
          key: 'yingkou'
        },
        {
          title: '阜新',
          width: 100,
          align: 'center',
          key: 'fuxin'
        },
        {
          title: '朝阳',
          width: 100,
          align: 'center',
          key: 'chaoyang'
        },
        {
          title: '丹东',
          width: 100,
          align: 'center',
          key: 'dandong'
        },
        {
          title: '盘锦',
          width: 100,
          align: 'center',
          key: 'panjin'
        },
        {
          title: '锦州',
          width: 100,
          align: 'center',
          key: 'jinzhou'
        },
        {
          title: '葫芦岛',
          width: 100,
          align: 'center',
          key: 'huludao'
        },
        {
          title: '合计',
          width: 100,
          align: 'center',
          key: 'sum'
        }
      ],
      data5: [
        /* {
          name: '省内转运小计',
          age: 18,
          address: 'New York No. 1 Lake Park',
          date: '2016-10-03'
        },
        {
          name: '省外转运小计',
          age: 24,
          address: 'London No. 1 Lake Park',
          date: '2016-10-01'
        },
        {
          name: '当日转运总计',
          age: 30,
          address: 'Sydney No. 1 Lake Park',
          date: '2016-10-02'
        } */
      ]
    }
  },
  mounted () {
    const data = []
    data.push({
      datetime: '3月22日',
      sum: 154,
      dalian: 11,
      anshan: 10,
      fushun: 64,
      benxi: 17,
      hengren: 0,
      tieling: 24,
      liaoyang: 8,
      yingkou: 0,
      fuxin: 4,
      chaoyang: 1,
      dandong: 8,
      panjin: 0,
      jinzhou: 0,
      huludao: 1
    })
    data.push({
      datetime: '3月23日',
      sum: 107,
      dalian: 0,
      anshan: 8,
      fushun: 41,
      benxi: 7,
      hengren: 0,
      tieling: 29,
      liaoyang: 5,
      yingkou: 4,
      fuxin: 2,
      chaoyang: 0,
      dandong: 4,
      panjin: 1,
      jinzhou: 3,
      huludao: 3
    })
    data.push({
      datetime: '3月24日',
      sum: 113,
      dalian: 0,
      anshan: 6,
      fushun: 59,
      benxi: 18,
      hengren: 0,
      tieling: 16,
      liaoyang: 3,
      yingkou: 1,
      fuxin: 1,
      chaoyang: 1,
      dandong: 5,
      panjin: 2,
      jinzhou: 0,
      huludao: 1
    })
    data.push({
      datetime: '3月25日',
      sum: 145,
      dalian: 7,
      anshan: 10,
      fushun: 60,
      benxi: 20,
      hengren: 0,
      tieling: 30,
      liaoyang: 6,
      yingkou: 5,
      fuxin: 5,
      chaoyang: 1,
      dandong: 5,
      panjin: 1,
      jinzhou: 1,
      huludao: 0
    })
    data.push({
      datetime: '3月26日',
      sum: 63,
      dalian: 1,
      anshan: 0,
      fushun: 24,
      benxi: 20,
      hengren: 0,
      tieling: 11,
      liaoyang: 1,
      yingkou: 2,
      fuxin: 0,
      chaoyang: 0,
      dandong: 4,
      panjin: 0,
      jinzhou: 0,
      huludao: 0
    })
    data.push({
      datetime: '3月27日',
      sum: 115,
      dalian: 3,
      anshan: 7,
      fushun: 48,
      benxi: 13,
      hengren: 0,
      tieling: 21,
      liaoyang: 2,
      yingkou: 0,
      fuxin: 2,
      chaoyang: 0,
      dandong: 4,
      panjin: 12,
      jinzhou: 1,
      huludao: 2
    })
    data.push({
      datetime: '3月28日',
      sum: 88,
      dalian: 0,
      anshan: 2,
      fushun: 36,
      benxi: 19,
      hengren: 0,
      tieling: 17,
      liaoyang: 3,
      yingkou: 2,
      fuxin: 3,
      chaoyang: 0,
      dandong: 2,
      panjin: 2,
      jinzhou: 1,
      huludao: 1
    })
    this.data5 = data
  },
  methods: {
    handleSpan ({ row, column, rowIndex, columnIndex }) {
      if (rowIndex === 0 && columnIndex === 1) {
        return [1, 1]
      } else if (rowIndex === 0 && columnIndex === 2) {
        return [0, 0]
      } else if (rowIndex === 0 && columnIndex === 3) {
        return [0, 0]
      }
    }
  }
}
</script>
